Skip to content

fix for issue #1295 "leonardo as keyboard does not wake windows 7 from sleep" #1488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from

Conversation

nospam2000
Copy link

This adds a new feature to fix issue #1295 "leonardo as keyboard does not wake windows 7 from sleep"

It makes it possible to wake up the PC when it is in standby mode. Use the following code in the Sketch:
USBDevice.wakeupHost();

Another feature has been added to send the PC to sleep mode:
Keyboard.systemControl(SYSTEM_CONTROL_SLEEP);

See also the discussion in the forum http://forum.arduino.cc/index.php?topic=150157

Tested by me on
Mac OSX (on a MacBook Pro)
Windows 7 (on a MacBook Pro)
Windows 8 (on a Wetab)

@yahesh
Copy link

yahesh commented Jul 18, 2013

The Keyboard.pressRaw() and Keyboard.releaseRaw() are redundant to #1391 where I rewrote the whole methods to handle some other issues as well.

@nospam2000
Copy link
Author

Hi Kenneth,

On 18.07.2013, at 09:49, Kenneth Newwood [email protected] wrote:

The Keyboard.pressRaw() and Keyboard.releaseRaw() are redundant to #1391 where I rewrote the whole methods to handle some other issues as well.

Thanks, I haven't seen that and will remove it from my patch.

One issue still remains: the HID report defines only usages and a logical maximum of 0x65, so the usages above 0x65 (e.g. KEYCODE_POWER) can not be used. I changed this also in my patch in HID.cpp:

  • 0x25, 0x65, // LOGICAL_MAXIMUM (101)
  • 0x26, 0xDF, 0x00, // LOGICAL_MAXIMUM (239)
  • 0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
  • 0x29, 0xDF, // USAGE_MAXIMUM (Left Control - 1)

Be careful: the logic maximum is a signed integer, therefore it needs a 16-bit integer for the value 239 instead of the 8-bit value.

With Best Regards,

Michael

…ontained in the fix for issue arduino#1391 and the code was redundant
… as requested in issue arduino#1417.

all parameters have the range of -32768 to 32767 and must be scaled to screen pixels
some examples:
  x=0, y=0 is the middle of the screen
  x=-32768, y=-32768 is the top left corner
  x=32767, y=-32768 is the top right corner
  x=32767, y=32767 is the bottom right corner
  x=-32768, y=32767 is the bottom left corner
@ffissore ffissore added New and removed New labels Feb 27, 2014
@ArduinoBot
Copy link
Contributor

Can I build this pull request?

@ArduinoBot
Copy link
Contributor

Can one of the admins verify this patch?

@cmaglie cmaglie added feature request A request to make an enhancement (not a bug fix) Component: USB Device Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...) Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) labels Apr 15, 2015
@NicoHood
Copy link
Contributor

NicoHood commented Oct 6, 2015

This may be closed now with the new pluggable USB core.

@facchinm
Copy link
Member

facchinm commented Oct 7, 2015

Right! 👍

@facchinm facchinm closed this Oct 7, 2015
@ffissore ffissore modified the milestone: Release 1.6.6 Oct 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Component: Core Related to the code for the standard Arduino API Component: USB Device Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...) feature request A request to make an enhancement (not a bug fix)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants